package com.banmoon.singleton;

/**
 * 懒汉式（线程安全，同步代码块）
 */
public class Singleton05 {

    private Singleton05() {
    }

    private static Singleton05 instance;

    public static Singleton05 getInstance(){
        synchronized(Singleton05.class){
            if(instance==null)
                instance = new Singleton05();
        }
        return instance;
    }

}
